<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="model.dao.*, model.pojo.*, java.util.*"%>

<link rel="stylesheet" type="text/css" href="templates/style.css" />
 <script type="text/javascript" src="mainscripts/ddsmoothmenu.js"></script>
 
<!-- Header -->
    <div id="Header">
        <div class="header_col1"><img style="padding-top: 12px; padding-bottom: 5px;" title="Nam &Aacute;" src="userfiles/files/images/logo.jpg" alt="Nam &Aacute;" width="85" height="75" /></div>
        <div class="header_col2">
            <div class="menu_info">
                <a href="vi/html/id1/Gioi-thieu/">Giới thiệu</a> | 
                <a href="vi/xemgiohang/">Giỏ h&agrave;ng</a> | 
                <a title="Download Driver" href="vi/downloaddriverds/id0/downloaddriver/">Download Driver</a> | 
                <a href="vi/mhdk/">Đăng k&yacute; đại l&yacute; </a>| <a href="vi/html/id2/Lien-he/">Li&ecirc;n hệ</a>
            </div>
            <div class="visa_logo">
                <a href="http://apple.nama.com.vn/" target="_blank"><br /><img src="userfiles/files/thanhngangHp2.jpg" alt="" width="714" height="80" /></a>
            </div>
        </div><br class="clr" />
    </div>
<!-- End Header -->
    
<!-- Menu -->
<div id="Menu">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td>
        <div id="nama_menu" class="n_menu">
            <%
                ArrayList<Menu> dsMenu = (ArrayList<Menu>) request.getAttribute("Menu");
                if(dsMenu.size() != 0)
                {
                    for(int i = 0; i < dsMenu.size(); i++)
                    {
                        Menu mn = dsMenu.get(i);
            %> 
                        <ul>
                            <li><a href='<%= mn.getLink()%>'><%= mn.getNameMenu()%></a>
                            <%
                            ArrayList<BrandName> dsBrandName = MenuDAO.getBrandName(mn.getIdMenu());
                            if(dsBrandName.size() != 0)
                            {
                            %>
                                <ul>
                                <%
                                for(int j = 0; j < dsBrandName.size(); j++)
                                {
                                    BrandName bn = dsBrandName.get(j);
                                %>
                                    <li><a href=''><%= bn.getNameBrandName()%></a>
                                    <%
                                    ArrayList<Catalogue> dsCatalogue = MenuDAO.getCatalogue(bn.getIdBrandName()); 
                                    if(dsCatalogue.size() != 0)
                                    {
                                    %>
                                        <ul>
                                        <%
                                        for(int l = 0; l < dsCatalogue.size(); l++)
                                        {
                                            Catalogue cl = dsCatalogue.get(l);
                                        %>
                                            <li><a href=''><%= cl.getNameCatalogue()%></a></li>
                                        <%}%>
                                        </ul>
                                        </li>
                                    <%}
                                    else
                                    {%>
                                        </li>
                                    <%}
                                }%>
                                </ul>
                                </li>
                                </ul>
                            <%}
                            else
                            {%>
                                </li>
                                </ul>
                            <%}
                        }
                    }
                %>	
        </div>
        </td>
        <td width="200" style="background:url(templates/images/search.gif); padding:5px 5px 5px 25px">
            <input style="background:none; border:none; color:#fff" onkeydown="if(event.keyCode==13)submit_form('','nuttimkiem','xml/timkiem_sanpham.php?lang=vi','hop_timkiem')" id="hop_timkiem" type="text" value="" />
        </td>
    </tr>
</table>
</div>
<!-- End Menu -->
<script type="text/javascript">
ddsmoothmenu.init({	mainmenuid: "nama_menu", orientation: 'h', classname: 'n_menu', contentsource: "markup" })
</script>